import '../css/newsDetail.css';
import ajax from '../js/ajax';

const title = document.querySelector('h2');
const content = document.querySelector('p');

ajax('get', '/api/news/hot', {
    id: JSON.parse(localStorage.getItem('newsid'))
}).then(({ flag, data }) => {
    if (flag) {
        title.innerText = data[0].title;
        content.innerText = data[0].content;
    }
})